package com.etocrm.saas.lib.base.common.request;

import com.alibaba.ttl.TransmittableThreadLocal;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class RequestInfoHolder {
    private static final TransmittableThreadLocal<RequestInfo> HOLDER = new TransmittableThreadLocal<>();

    /**
     * 设置当前请求的信息
     *
     * @param info
     */
    public static void set(RequestInfo info) {
        HOLDER.set(info);
    }

    /**
     * 获取当前的请求信息
     *
     * @return
     */
    public static RequestInfo get() {
        return HOLDER.get();
    }

}
